export default {
  data() {
    return {
      detaillistLoading: true,
      detailModelVisible: false,
      detailTablelist: [],
      detailTableTotal: 0,
      detailTableParams: { skipcount: 1, maxresultcount: 50 }
    }
  },
  methods: {
    httpDetailActions() {
      this.detaillistLoading = true
      this.api[this.httpDetailUrl]({ ...this.tableParams, ...this.detailTableParams })
        .then(res => {
          this.detailTablelist = res.items
          this.detailTableTotal = res.totalCount
        })
        .finally(() => {
          this.detaillistLoading = false
        })
    },
    searchDetailHandle() {
      this.detailTableParams.skipcount = 1
      this.httpDetailActions()
    },
    changeDetailcurrent(val) {
      this.detailTableParams.skipcount = val
      this.httpDetailActions()
    },
    changeDetailPagination(maxresultcount) {
      this.detailTableParams.skipcount = 1
      this.detailTableParams.maxresultcount = maxresultcount
      this.httpDetailActions()
    },
    resetDetailQueryParams() {
      this.setQueryParams({})
      this.httpDetailActions()
    },
    cancelDetailFormAction() {
      this.detailModelVisible = false
    }
  }
}
